<!--  -->
<template>
  <div class="bot4">
    <div class="headerMaintitle">
      <img class="topPic" src="../assets/rightBottom3.png" alt="" />
      <div class="headerText">标题1</div>
    </div>
    <a-carousel ref="swipeView" class="swipe" dotsClass="dots" :dots="true">
      <div class="group">
        <div v-for="(item, index) in group" :key="index" class="item">
          <div class="item-value">
            {{ item.value }}
          </div>
          <div class="item-text">{{ item.text }}</div>
        </div>
      </div>
      <div class="group">
        <div v-for="(item, index) in group1" :key="index" class="item">
          <div class="item-value">
            {{ item.value }}
          </div>
          <div class="item-text">{{ item.text }}</div>
        </div>
      </div>
      <div class="group">
        <div v-for="(item, index) in group2" :key="index" class="item">
          <div class="item-value">
            {{ item.value }}
          </div>
          <div class="item-text">{{ item.text }}</div>
        </div>
      </div>
    </a-carousel>
    <!-- </div> -->
  </div>
</template>

<script>
export default {
  components: {},
  data() {
    return {
      group: [
        { text: "N95口罩(个)", value: 11427 },
        { text: "防护服(个)", value: 42780 },
        { text: "隔离面罩(个)", value: 44390 },
        { text: "隔离衣(个)", value: 19143 },
        { text: "护目镜/眼罩(套)", value: 12051 },
        { text: "洗手液(瓶)", value: 5168 },
      ],
      group1: [
        { text: "测温仪(台)", value: 11427 },
        { text: "一次性手套(个)", value: 11427 },
        { text: "一次性医用口罩(个)", value: 11427 },
        { text: "民用口罩(个)", value: 11427 },
        { text: "医用鞋套(双)", value: 11427 },
        { text: "医用帽(个)", value: 11427 },
      ],
      group2: [
        { text: "手持喇叭(个)", value: 11427 },
        { text: "应急灯(个)", value: 11427 },
        { text: "防风帐篷(个)", value: 11427 },
      ],
      timer: null,
    };
  },
  beforeDestroy() {
    clearInterval(this.timer);
  },
  mounted() {
    this.init();
    this.timer = setInterval(() => {
      this.$refs.swipeView.next();
    }, 6000);
  },
  methods: {
    init() {
      this.group.forEach((e) => {
        e.value = parseInt(parseInt(Math.random() * 10000) / Math.random());
      });
      this.group1.forEach((e) => {
        e.value = parseInt(parseInt(Math.random() * 10000) / Math.random());
      });
      this.group2.forEach((e) => {
        e.value = parseInt(parseInt(Math.random() * 10000) / Math.random());
      });
    },
  },
};
</script>

<style lang="less" scoped>
.swipe {
  margin: 0 auto;
  margin-top: -10px;
  width: 100%;
  height: 313px;
}

.group {
  display: flex !important;
  flex-wrap: wrap;
  justify-content: space-between;
  align-content: space-between;
  padding: 0px 10px;

  .item {
    z-index: 99;
    display: flex;
    flex-direction: column;
    width: 214px;
    height: 166px;
    background-image: url("../assets/numbg.png");
    background-size: 214px 166px;

    .item-value {
      margin: 0 auto;
      margin-top: 36px;
      font-size: 36px;
      font-weight: 600;
      color: #00f8fd;
    }

    .item-text {
      margin-top: 22px;
      font-size: 23px;
      font-weight: 400;
      color: #ffffff;
      text-align: center;
    }
  }
}
</style>

<style lang="less">
.ant-carousel .slick-dots-bottom {
  bottom: -23px !important;
}
.dots {
  width: 10px;
  height: 10px;
  border-radius: 5px;
}
.ant-carousel .slick-dots li button {
  width: 6px !important;
  height: 6px !important;
  border-radius: 3px !important;
  margin-right: 8px !important;
  background: #39d2ff !important;
  opacity: 0.3;
}

.ant-carousel .slick-dots li.slick-active button {
  background: #39d2ff !important;
}
</style>
